Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.setHistoryList = exports.getHistoryList = void 0;
var e = require("../../../@babel/runtime/helpers/toConsumableArray"),
  t = require("../../../@babel/runtime/helpers/objectSpread2"),
  r = require("../../../store/index"),
  i = ["pages/index/index", "pages/recruit/index", "subpackage/machine-list-search/index"];
exports.getHistoryList = function (e) {
  var i = r.store.getState().storage.browsingHistoryUuidList;
  return e ? null == e ? void 0 : e.map((function (e) {
    var r = i.findIndex((function (t) {
      return t === e.uu
    }));
    return t(t({}, e || {}), {}, {
      isBrowse: -1 !== r
    })
  })) : []
};
exports.setHistoryList = function (t) {
  var s;
  if (t || null != t && t.uu) {
    var n = getCurrentPages(),
      o = n[n.length - 1],
      u = r.store.getState().storage.browsingHistoryUuidList;
    (null === (s = u) || void 0 === s ? void 0 : s.length) > 600 && (u = u.filter((function (e, t) {
      return t > 100
    }))), -1 !== i.indexOf((null == o ? void 0 : o.route) || "") && -1 === u.findIndex((function (e) {
      return e === t.uu
    })) && t.uu && (0, r.dispatch)(r.actions.storageActions.setItem({
      key: "browsingHistoryUuidList",
      value: [].concat(e(u), [t.uu])
    }))
  }
};